//
//  FirstViewController.m
//  07-ViewController的生命周期
//
//  Created by 王道林 on 16/7/22.
//  Copyright © 2016年 王道林. All rights reserved.
//

#import "FirstViewController.h"

@interface FirstViewController ()

@end

@implementation FirstViewController

//  loadView 和 viewDidLoad  viewWillApppear
// 以上的三个方法会插在上个视图控制器的 ViewWillDisappear 和  viewDidDisappear 中间
- (void)loadView
{
    [super loadView];
    NSLog(@"%@ -----%s", [self class], __FUNCTION__);
}

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    self.view.backgroundColor = [UIColor redColor];
    NSLog(@"%@ -----%s", [self class], __FUNCTION__);
    
    
//    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"点击" style:UIBarButtonItemStylePlain target:self action:@selector(barButton)];
//    
//    
}


//  视图将要出现时, 就会调用
- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    NSLog(@"%@ -----%s", [self class], __FUNCTION__);
}
//  视图完全出现时候
- (void)viewDidAppear:(BOOL)animated
{
    [super viewDidAppear:animated];
    NSLog(@"%@ -----%s", [self class], __FUNCTION__);
}

// 将要消失时候
- (void)viewWillDisappear:(BOOL)animated
{
    [super viewWillDisappear:animated];
    NSLog(@"%@ -----%s", [self class], __FUNCTION__);
}

// 完全消失的时候
- (void)viewDidDisappear:(BOOL)animated
{
    [super viewDidDisappear:animated];
    NSLog(@"%@ -----%s", [self class], __FUNCTION__);
}




- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
